import { inject } from 'mobx-react'
import Auth from './Auth'
import authStore from './AuthStore'
import Project from './Project'
import projectStore from './ProjectStore'
import Page2Store from './Page2Store'

export * from './Local'

const stores = {
    auth: authStore,
    project: projectStore,
    page2Store: Page2Store,
}

const actions = {
    auth: new Auth(stores),
    project: new Project(stores),
}

export function getState() {
    return stores
}

export function getAction() {
    return actions
}

export function withStore(propName: string[]) {
    return inject(...propName)
}